package com.example.demo.service;

import com.example.demo.entity.Upvote;
import com.example.demo.mapper.UpvoteMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UpvoteService {
    @Autowired
    private UpvoteMapper upvoteMapper;

    public void updUpvote(Upvote upvote) {
        upvoteMapper.updUpvote(upvote);
    }

    public void insertUpvote(Integer uid, Integer artid, Integer state) {
        upvoteMapper.insertUpvote(uid, artid, state);
    }

    public Upvote selUpvote(Integer uid, Integer artid) {
        return upvoteMapper.selUpvote(uid, artid);
    }

    public List<Integer> getArtId(Integer uid) {
        return upvoteMapper.getArtId(uid);
    }

    public void delUpvoteArt(Integer artid) {
        upvoteMapper.delUpvoteArt(artid);
    }
}
